﻿/*=================================================================
* 版权信息：Copyright (C) 2005-2011 捷点科技 All Rights Reserved.
* 文件名称：CNVP_Order.cs
* 创建标识：曾乃强 15158756652 2011-04-14 04:04:14
* 修改标识：
* 功能描述：业务层
===================================================================*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using CNVP.Framework;
using CNVP.Framework.Helper;

namespace CNVP.JShop.BLL 
{
    /// <summary>
    /// 对*CNVP_Order*操作(针对业务层)的实现
    /// </summary>
    public class CNVP_Order
    {
        DAL.CNVP_Order dal = new DAL.CNVP_Order();
        
        #region BLL
        #region 添加
        /// <summary>
        /// 添加
        /// </summary>
        public int Add_CNVP_Order(Model.CNVP_Order obj)
        {
            return dal.Insert(obj);
        }
        #endregion
        
        #region 修改
        /// <summary>
        /// 修改
        /// </summary>
        public int Update_CNVP_Order(Model.CNVP_Order obj)
        {
            return dal.Update(obj);
        }
        #endregion
        
        #region 删除
        /// <summary>
        /// 删除
        /// </summary>
        public int Delete_CNVP_Order(Model.CNVP_Order obj)
        {
            return dal.Delete(obj);
        }
        
        /// <summary>
        /// 删除,生成列的主键列构成的参数列表
        /// </summary>
        public int Delete_CNVP_Order(int ID)
        {
            return this.Delete_CNVP_Order(new Model.CNVP_Order() {
            
                 ID=ID
            });
        }
        #endregion 
        
        /// <summary>
        /// 查看单个
        /// </summary>
        public Model.CNVP_Order GetSingle_CNVP_OrderById(int ID)
        {
            return dal.LoadById(ID);
        }
        /// <summary>
        /// 查看全部
        /// </summary>
        public List<Model.CNVP_Order> GetAll_CNVP_Order(string sqlWhere)
        {
            return dal.LoadAll(sqlWhere);
        }
        /// <summary>
        /// 查看全部
        /// </summary>
        public List<Model.CNVP_Order> GetAll_CNVP_Order()
        {
            return this.GetAll_CNVP_Order("");
        }
        /// <summary>
        /// 分页
        /// </summary>
        public DataTable GetPage(string PageName, int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetPage(PageName, PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition);
        }
        #endregion

        /// <summary>
        /// 修改
        /// </summary>
        public int Update_CNVP_OrderAddress(Model.CNVP_Order obj)
        {
            return dal.UpdateAddress(obj);
        }

        /// <summary>
        /// 修改,准备发货(到付或已付)
        /// </summary>
        public int Update_CNVP_OrderShow3(Model.CNVP_Order obj)
        {
            return dal.UpdateOrderShow3(obj);
        }
         /// <summary>
        /// 修改,等待付款
        /// </summary>
        public int Update_CNVP_OrderShow(Model.CNVP_Order obj)
        {
            return dal.UpdateOrderShow(obj);
        }

         /// <summary>
        /// 计算数量 by OrderState
        /// </summary>
        public int NumByBuyerIDAndOrderState(int BuyerID, string OrderStateArray)
        {
            return dal.NumByBuyerIDAndOrderState(BuyerID, OrderStateArray);
        }

        /// <summary>
        /// 修改,订单状态
        /// </summary>
        public int UpdateOrderState(Model.CNVP_Order obj)
        {
            return dal.UpdateOrderState(obj);
        }

        /// <summary>
        /// 修改,订单状态By订单号
        /// </summary>
        public int UpdateOrderStateByNo(Model.CNVP_Order obj)
        {
            return dal.UpdateOrderStateByNo(obj);
        }

         /// <summary>
        /// 查看配送信息
        /// </summary>
        public Model.CNVP_Order GetDeliveryInfoById(int ID)
        {
            return dal.LoadDeliveryInfoById(ID);
        }

        /// <summary>
        /// 分页
        /// </summary>
        public DataTable GetPageReview(string PageName, int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetPageReview(PageName, PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition);
        }

    }
}

